package com.wanxi.faceobject.template.test2;

//）声明一个子类HourEmployee小时工，继承父类Employee
//
//- 有属性，double类型的工作小时数和每小时多少钱
//- 提供有参构造public HourEmployee(String name, double moneyPerHour)
//- 提供有参构造public HourEmployee(String name, double moneyPerHour, double hour)
//- 重写方法，public double earning()返回实发工资， 实发工资 = 每小时多少钱 * 小时数
//- 重写方法，public String getInfo()：显示姓名和实发工资，时薪，工作小时数
public class HourEmployee extends Employee {
    private int hour;
    private double moneyPerHour;

    public HourEmployee() {
    }

    @Override
    public double earnings() {
        return hour * moneyPerHour;
    }

    public HourEmployee(String name, int id, MyDate birthday, int hour, double moneyPerHour) {
        super(name, id, birthday);
        this.hour = hour;
        this.moneyPerHour = moneyPerHour;
    }

//    public String getInfo(){
//        return "HourEmployee["+ super.getInfo()+"]";
//    }

}
